/**
 * 初始化VUE
 */
/**try {
	new Vue({
		...mainApp, ...{
			//mounted: vueMounted,
			created: vueCreated,
			//computed: vueComputed||{},
			data: { ...mainApp.data, ...vueData },
			methods: { ...mainApp.methods, ...vueMethods }
		}
	});
} catch (e) {
	console.log(e)
}*/
if (typeof _data == 'undefined') {
	_data = {}
}
if (typeof _method == 'undefined') {
	_method = {}
}
if (typeof _created == 'undefined') {
	_created = function(){
		
	}
}
if (typeof _watch == 'undefined') {
	_watch = {}
}
if (typeof _components == 'undefined') {
	_components = {}
}else{
	Object.keys(_components).forEach(key => {
		let url = _components[key]
	  _components[key]  = Vue.defineAsyncComponent( () => loadModule(url, options) )
	});
}
const vueApp = {
	data() {
		return {
			..._data,
			activeMenuGroup: 'admin',
			activeMenu: 'index',
			loginName: '欢迎：码农小鹿',
			elelMianHeight: 0
		};
	},
	methods: {
		..._method,
		selectMenu(key, keyPath) {
			window.location.href = window.location.origin + key
		},
		toIndex() {
			window.location.href = window.location.origin + '/'
		}, 
		changeMenu(){
			var pss = window.location.pathname.split('/');
			this.activeMenuGroup = pss[pss.length - 2]
			var mm = pss[pss.length - 1]
			if(mm == 'projectDetail'){
				mm = 'myProject'
			}
			this.activeMenu = '/' + mm
		}
	},
	created: _created,
	mounted: function() {
		that = this
		this.changeMenu()
		if(this.$refs.elelMian){
			var elelMianRef = this.$refs.elelMian.$el;
			that.elelMianHeight = elelMianRef.clientHeight
		}
	},
	watch: {
		..._watch
	},
	components: _components
	//'my-component': 'url:/js/component/my-component.vue'
};
const pageApp = Vue.createApp(vueApp);
/**pageApp.directive('drawerDrag', {
  bind(el, binding, vnode, oldVnode) {
    const minWidth = 400
    const dragDom = el.querySelector('.el-drawer')
    dragDom.style.overflow = 'inherit'

    const resizeElL = document.createElement('div')
    const img = new Image(24, 38)
    // 拖拽图标，不需要可去除
    //img.src = require('@/assets/other/drag.png')
	img.src = "/img/node/setting.png"
    dragDom.appendChild(img)
    dragDom.appendChild(resizeElL)
    resizeElL.style.cursor = 'w-resize'
    resizeElL.style.position = 'absolute'
    resizeElL.style.height = '38px'
    resizeElL.style.width = '30px'
    resizeElL.style.left = '-15px'
    resizeElL.style.top = '50%'
    resizeElL.userSelect = 'none'
    img.style.position = 'absolute'
    img.style.left = '-12px'
    img.style.top = '50%'
    img.style.border = '1px solid #dbdbdb'
    img.style.backgroundColor = '#fff'
    img.style.borderRadius = '4px'
    img.style.userSelect = 'none'

    resizeElL.onmousedown = (e) => {
      const elW = dragDom.clientWidth
      const EloffsetLeft = dragDom.offsetLeft
      const clientX = e.clientX
      document.onmousemove = function(e) {
        e.preventDefault()
        document.body.style.userSelect = 'none'
        // 左侧鼠标拖拽位置
        // clientX > EloffsetLeft 如果不允许点击外面的内容可以拖拽的话设置这个
        if (clientX < EloffsetLeft + 30) {
          // 往左拖拽
          if (clientX > e.clientX) {
            dragDom.style.width = elW + (clientX - e.clientX) + 'px'
          }
          // 往右拖拽
          if (clientX < e.clientX) {
            if (dragDom.clientWidth >= minWidth) {
              dragDom.style.width = elW - (e.clientX - clientX) + 'px'
            }
          }
        }
      }
      // 拉伸结束
      document.onmouseup = function(e) {
        document.onmousemove = null
        document.onmouseup = null
        document.body.style.userSelect = 'auto'
      }
    }
  }
})**/
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
	pageApp.component(key, component)
}
pageApp.use(ElementPlus);
pageApp.mount("#appMain");